#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：retrying模块的使用.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-11-20 14:30
'''
import time

from retrying import retry

num = 1

@retry(stop_max_attempt_number=3)
def test():
    global num

    print("num=", num)

    num+=1
    time.sleep(1)
    for temp in 100:
        print(temp)

try:
    test()
except Exception as e:
    print("程序异常：", e)